<template>
  <div>
   <h4>第一题</h4>
    <button @click="arr1">点击</button>
    <p>{{ name }}</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      arr:["小花", "小明", "小可爱", "小王"],
      name : ''
    }
  },
  methods:{
    arr1(){
      let num = Math.floor(Math.random() * this.arr.length)
      this.name = this.arr[num]
      //this.arr = this.arr.num
    }
    
  }
}
</script>

<style scoped>

</style>